package com.chen.exception;

/**
 * @author: cgd
 * @description:
 * @date: 2022/4/13 13:28
 * @version: 1.0
 */
public class BaseException extends RuntimeException {
    private static final long serialVersionUID = 4206789752267888707L;
    protected BaseExceptionEnum baseExceptionEnum;

    public BaseException() {
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(BaseExceptionEnum baseExceptionEnum) {
        super(baseExceptionEnum.getMessage());
        this.baseExceptionEnum = baseExceptionEnum;
    }

    public BaseException(BaseExceptionEnum baseExceptionEnum, String message) {
        super(message);
        this.baseExceptionEnum = baseExceptionEnum;
    }

    public BaseException(BaseExceptionEnum baseExceptionEnum, String message, Throwable cause) {
        super(message, cause);
        this.baseExceptionEnum = baseExceptionEnum;
    }

    public BaseException(BaseExceptionEnum baseExceptionEnum, Throwable cause) {
        super(baseExceptionEnum.getMessage(), cause);
        this.baseExceptionEnum = baseExceptionEnum;
    }

    @Override
    public String toString() {
        return super.toString();
    }

    public BaseExceptionEnum getExceptionEnum() {
        return this.baseExceptionEnum;
    }
}
